home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 2.00 Begin Form AttrLab BackColor = &H00C0C0C0& Caption = "Attributes Lab" ClientHeight = 5460 ClientLeft = 15 ClientTop = 420 ClientWidth = 9555 Height = 5895 Left = -60 LinkTopic = "Form1" ScaleHeight = 5460 ScaleWidth = 9555 Top = 60 Width = 9705 Begin CommonDialog ImaDialogue Left = 8280 Top = 3480 End Begin VIEW3D VIEW3D_ATT AngleX = 0 AngleY = 0 AngleZ = 0 AutoRedraw = -1 'True BackGnd = 0 BackName = "" BackStyle = 0 ' 0-None FlgBox = 0 'False FlgEditable = -1 'True FlgOutline = 0 'False FlgShadow = 0 'False FlgWire = 0 'False Height = 4695 Left = 360 ObjName = "" PosX = 0 PosY = 0 PosZ = 0 Redraw = 0 Top = 120 Width = 5655 End Begin CommandButton CmdCol Caption = "PrevCol" Height = 255 Index = 1 Left = 7320 TabIndex = 30 Top = 3360 Width = 855 End Begin CommandButton CmdCol Caption = "NextCol" Height = 255 Index = 0 Left = 8400 TabIndex = 29 Top = 3360 Width = 855 End Begin SSFrame Frame3D5 Caption = "Change model for ALL faces" Font3D = 0 'None ForeColor = &H00000000& Height = 615 Left = 6120 TabIndex = 25 Top = 3600 Width = 3255 Begin CommandButton Cmd_Attr Caption = "Normal" Height = 255 Index = 0 Left = 120 TabIndex = 28 Top = 240 Width = 855 End Begin CommandButton Cmd_Attr Caption = "Shaded" Height = 255 Index = 1 Left = 1200 TabIndex = 27 Top = 240 Width = 855 End Begin CommandButton Cmd_Attr Caption = "Gouraud" Height = 255 Index = 2 Left = 2280 TabIndex = 26 Top = 240 Width = 855 End End Begin CommandButton CmdOk Caption = "Ok" Height = 375 Left = 7680 TabIndex = 21 Top = 5040 Width = 1695 End Begin SSFrame Frame3D4 Caption = "Actions" Font3D = 0 'None ForeColor = &H00000000& Height = 735 Left = 6120 TabIndex = 17 Top = 4200 Width = 3255 Begin ComboBox CombTypeBackg Height = 315 Left = 2280 Style = 2 'Dropdown List TabIndex = 32 Top = 360 Width = 975 End Begin CommandButton Browse Caption = "Browse" Height = 255 Left = 1200 TabIndex = 20 Top = 240 Width = 855 End Begin CommandButton Load Caption = "Load..." Height = 255 Left = 120 TabIndex = 19 Top = 240 Width = 855 End Begin CommandButton CmdDebug Caption = "Backg..." Height = 255 Left = 2280 TabIndex = 18 Top = 120 Width = 855 End End Begin SSFrame Frame3D1 Caption = "Options" Font3D = 0 'None ForeColor = &H00000000& Height = 1095 Left = 6120 TabIndex = 12 Top = 2160 Width = 3255 Begin SSCheck Check3D1 Caption = "Flag Outline" Font3D = 0 'None Height = 255 Index = 2 Left = 120 TabIndex = 16 Top = 720 Value = -1 'True Width = 1455 End Begin SSCheck Check3D1 Caption = "Flag Oriented" Font3D = 0 'None Height = 255 Index = 1 Left = 120 TabIndex = 15 Top = 480 Width = 1455 End Begin SSFrame Frame3D3 Caption = "Mutual options" Font3D = 0 'None ForeColor = &H00000000& Height = 855 Left = 1680 TabIndex = 14 Top = 120 Width = 1455 Begin SSCheck Check3D1 Caption = "Flag Box" Font3D = 0 'None Height = 255 Index = 4 Left = 120 TabIndex = 23 Top = 480 Width = 1215 End Begin SSCheck Check3D1 Caption = "Flag Wire" Font3D = 0 'None Height = 255 Index = 3 Left = 120 TabIndex = 22 Top = 240 Width = 1215 End End Begin SSCheck Check3D1 Caption = "Flag Shadow" Font3D = 0 'None Height = 255 Index = 0 Left = 120 TabIndex = 13 Top = 240 Width = 1455 End End Begin SSFrame Frame3D2 Caption = "Angles" Font3D = 0 'None ForeColor = &H00000000& Height = 2055 Left = 6120 TabIndex = 0 Top = 120 Width = 3255 Begin CommandButton StretchM Caption = "<<" Height = 255 Left = 960 TabIndex = 6 Top = 1680 Width = 495 End Begin CommandButton StretchP Caption = ">>" Height = 255 Left = 2400 TabIndex = 5 Top = 1680 Width = 615 End Begin HScrollBar HScrollX Height = 255 LargeChange = 16 Left = 960 Max = 360 TabIndex = 4 Top = 240 Width = 2055 End Begin HScrollBar HScrollY Height = 255 LargeChange = 16 Left = 960 Max = 360 TabIndex = 3 Top = 600 Width = 2055 End Begin HScrollBar HScrollZ Height = 255 Left = 960 Max = 360 TabIndex = 2 Top = 960 Width = 2055 End Begin HScrollBar HScroll_Prof Height = 255 Left = 960 Max = 200 Min = -200 TabIndex = 1 Top = 1320 Width = 2055 End Begin Label Label1 BackStyle = 0 'Transparent Caption = "Stretch" ForeColor = &H00FFFFFF& Height = 255 Index = 4 Left = 1560 TabIndex = 11 Top = 1680 Width = 735 End Begin Label Label1 BackStyle = 0 'Transparent Caption = "Prof:" ForeColor = &H00FFFFFF& Height = 255 Index = 3 Left = 120 TabIndex = 10 Top = 1320 Width = 735 End Begin Label Label1 BackStyle = 0 'Transparent Caption = "AngleZ:" ForeColor = &H00FFFFFF& Height = 255 Index = 2 Left = 120 TabIndex = 9 Top = 960 Width = 735 End Begin Label Label1 BackStyle = 0 'Transparent Caption = "AngleY:" ForeColor = &H00FFFFFF& Height = 255 Index = 1 Left = 120 TabIndex = 8 Top = 600 Width = 735 End Begin Label Label1 BackStyle = 0 'Transparent Caption = "AngleX:" ForeColor = &H00FFFFFF& Height = 255 Index = 0 Left = 120 TabIndex = 7 Top = 240 Width = 735 End End Begin Timer Timer1 Left = 6480 Top = 3480 End Begin CommonDialog Dialogue Left = 6960 Top = 3480 End Begin Label Label3 BackStyle = 0 'Transparent Caption = "Backg Col:" Height = 255 Left = 6120 TabIndex = 31 Top = 3360 Width = 1095 End Begin Label Label2 BackStyle = 0 'Transparent Caption = "Here you can play with some of the attributes of objects. Change the object by loading a new one . Read the doc to see all the possibilities" Height = 495 Left = 240 TabIndex = 24 Top = 4920 Width = 7335 End Option Explicit Dim MyObj As Long Dim MyView As Long Dim ax As Integer Dim ay As Integer Dim az As Integer Dim az2 As Integer Dim factor As Pt_3d_Float Dim startx Dim starty Dim Flg_Redraw Dim pos3d As pt_3D Dim numcolbackg Sub Browse_Click () attrlab.MousePointer = 11 FormBrowse.Show 1 If FormBrowse.FileName.Caption <> "" Then Call LoadObj(ObjDir$ + "\" + CStr(FormBrowse.FileName.Caption)) End If Unload FormBrowse attrlab.MousePointer = 0 End Sub Sub Check3D1_Click (Index As Integer, Value As Integer) Dim Tag As Integer Dim newval As Integer Dim Flag As Integer If Value = -1 Then newval = 1 Flag = True Else newval = 0 Flag = False End If Select Case Index Case 0: Tag = K_ID_FLG_SHADOW Case 1: Tag = K_ID_FLG_ORIENTED Case 2: Tag = K_ID_FLG_OUTLINE Case 3: Tag = K_ID_FLG_WIRE Check3D1(0).Enabled = Not Flag Check3D1(1).Enabled = Not Flag Check3D1(2).Enabled = Not Flag Case 4: Tag = K_ID_FLG_BOX Check3D1(0).Enabled = Not Flag Check3D1(1).Enabled = Not Flag Check3D1(2).Enabled = Not Flag Check3D1(3).Enabled = Not Flag End Select Call Objet3D_Set(MyObj, Tag, CLng(newval)) Call Redraw End Sub Sub Cmd_Attr_Click (Index As Integer) Dim attrib attrib = K_TYPE_FACE_NORMAL Select Case Index ' Normal Case 0 attrib = K_TYPE_FACE_NORMAL Case 1 attrib = K_TYPE_FACE_SHADED Case 2 attrib = K_TYPE_FACE_GOURAUD End Select Call Objet3D_SetAllFaces(MyObj, attrib) Call Redraw End Sub Sub CmdCol_Click (Index As Integer) Select Case Index Case 0: numcolbackg = numcolbackg + 1 Case 1: numcolbackg = numcolbackg - 1 End Select Call View3D_Set(MyView, K_Id_BACKGROUND, numcolbackg) Redraw End Sub Sub CmdDebug_Click () Imadialogue.Action = 1 View3D_Att.BackName = CStr(Imadialogue.Filename) End Sub Sub CmdMvt_Click () Load FormMvt End Sub Sub CmdOk_Click () Unload Me End Sub Sub CombTypeBackg_Click () View3D_Att.BackStyle = CombTypeBackg.ListIndex End Sub Sub Form_Load () factor.x = 1 factor.y = 1 factor.z = 1 MyObj = View3D_Att.IdObj MyView = View3D_Att.IdView View3D_Att.ObjName = ObjDir$ + "\dirigable.m3d" ax = 0 ay = 0 az = 0 az2 = 0 numcolbackg = 0 Flg_Redraw = 1 Imadialogue.InitDir = ObjDir$ Imadialogue.Filter = "GIF files (*.gif)|*.gif" Imadialogue.Filename = "*.gif" dialogue.InitDir = ObjDir$ dialogue.Filter = "Object3D (*.m3d)|*.m3d|Dxf(*.dxf) |*.dxf|ASCI from 3DS(*.asc)|*.asc|Painter 3D (*.d)|*.d" dialogue.Filename = "*.m3d" CombTypeBackg.Clear CombTypeBackg.AddItem "None" CombTypeBackg.AddItem "Centered" CombTypeBackg.AddItem "Tiled" CombTypeBackg.AddItem "Stretched" CombTypeBackg.ListIndex = 0 Show End Sub Sub HScroll_Prof_Change () Call Redraw End Sub Sub HScroll_Prof_Scroll () Call Redraw End Sub Sub hscroll2change () pos3d.x = hscrollx.Value pos3d.y = 0 pos3d.z = hscrollz.Value ' Call View3D_AffAll(MyView) ' Call View3D_Switch(MyView, PictureLab.hDC) End Sub Sub HScroll2X_Change () Call hscroll2change End Sub Sub HScroll2X_Scroll () Call hscroll2change End Sub Sub HScroll2Z_Change () Call hscroll2change End Sub Sub HScroll2Z_Scroll () Call hscroll2change End Sub Sub HScrollX_Change () Call Redraw End Sub Sub HScrollX_Scroll () Call Redraw End Sub Sub HScrollY_Change () Call Redraw End Sub Sub HScrollY_Scroll () Call Redraw End Sub Sub HScrollZ_Change () Call Redraw End Sub Sub HScrollZ_Scroll () Call Redraw End Sub Sub Load_Click () dialogue.Action = 1 Call LoadObj(CStr(dialogue.Filename)) End Sub Sub LoadObj (In_Name As String) attrlab.MousePointer = 11 View3D_Att.ObjName = In_Name Call Redraw attrlab.MousePointer = 0 End Sub Sub Redraw () If Flg_Redraw Then ax = hscrollx.Value ay = hscrolly.Value az = hscrollz.Value pos3d.x = 0 pos3d.y = 0 pos3d.z = hscroll_prof.Value ' PictureLab.Cls Call Objet3D_Set_Pos(MyObj, pos3d) ' PictureLab.Cls View3D_Att.AutoRedraw = 0 View3D_Att.AngleX = ax View3D_Att.AngleY = ay View3D_Att.AngleZ = az View3D_Att.Redraw = 1 End If End Sub Sub StretchM_Click () factor.x = 2 factor.y = 2 factor.z = 2 Call Objet3D_Stretch(MyObj, factor) Call Redraw End Sub Sub StretchP_Click () factor.x = .5 factor.y = .5 factor.z = .5 Call Objet3D_Stretch(MyObj, factor) Call Redraw End Sub Sub Timer1_Timer () hscrolly.Value = hscrolly.Value + 10 Call Redraw End Sub